<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\adminapi\controller\v1\analysis;

use app\adminapi\controller\AuthController;
use app\services\analysis\ScoreServices;
use think\facade\App;


class Score extends AuthController
{
    /**
     * @var ScoreServices
     */
    protected $service;

    /**
     * Article constructor.
     * @param App $app
     * @param ScoreServices $service
     */
    public function __construct(App $app, ScoreServices $service)
    {
        parent::__construct($app);
        $this->service = $service;
    }

    /**
     * @return int[]
     */
    public function overview(){
        $data = $this->service->overview();
        return app('json')->success($data);
    }

    /**
     * @return array|array[]
     */
    public function usable_detail(){
        $data = $this->service->usable_detail();
        return app('json')->success($data);
    }

    /**
     * @return array[]
     */
    public function income_detail(){
        $data = $this->service->income_detail();
        return app('json')->success($data);
    }

    /**
     * @return array[]
     */
    public function outcom_detail(){
        $data = $this->service->outcom_detail();
        return app('json')->success($data);
    }

    public function year_detail(){
        $data = $this->service->year_detail();
        return app('json')->success($data);
    }
}
